home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbwinfnt.zip / EX_LRSRC.BAS < prev    next >
BASIC Source File  |  1994-03-01  |  1KB  |  37 lines

  1.       REM:  EX_LRSRC.BAS, Unregistered Version 1.0
  2.       REM:  Example of loading a font from Windows resource files.
  3.  
  4.       DECLARE SUB FastString (Text$, FClr%, X%, Y%, FontArray%())
  5.       DECLARE SUB LoadRsrcFileFont (FlName$, FontNum%, FontArray%(), RetCode%, RetMsg$)
  6.  
  7.       '...setup a VGA screen mode...
  8.       SCREEN 12
  9.  
  10.       '...prompt for a file name and file number...
  11.       INPUT "Enter resource file name (typically FON file): ", FlName$
  12.       INPUT "Enter font number from file to load (try 1): ", FontNum%
  13.  
  14.       '...dim array for font data (use REDIM so its DYNAMIC)...
  15.       REDIM FontArray%(1)
  16.      
  17.       PRINT : PRINT "Loading font from "; FlName$; "..."
  18.      
  19.       '...load the specified font from the file...
  20.       CALL LoadRsrcFileFont(FlName$, FontNum%, FontArray%(), RetCode%, RetMsg$)
  21.      
  22.       IF (RetCode% <> 0) THEN
  23.        
  24.         PRINT
  25.         PRINT "***** ERROR: RetCode% = "; RetCode%
  26.         PRINT "***** "; RetMsg$
  27.        
  28.       ELSE
  29.      
  30.         '...display a sample of the font...
  31.         CALL FastString("Sample of Font ", 2, 20, 80, FontArray%())
  32.        
  33.       END IF
  34.      
  35.       END
  36.  
  37.